/***
 * 使用flowRight写一个sanitizeNames()函数，返回一个下划线连接的小写字符串，
 * 把数组中的name转换为这种形式，
 * 例如：sanitizeNames(['Hello World']) => ['Hello_world']
 */
const fp = require("lodash/fp")

let _underscore = fp.replace(/\W+/g,"_")

function sanitizeNames(){
    return fp.flowRight(fp.map(name=>_underscore(name)))
}

var name = ["hello world","bei jing"]

console.log(sanitizeNames()(name))